import cv2

img = cv2.imread('../asset/dog.jpg')
new_img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# ret, dst = cv2.threshold(new_img, 180, 255, cv2.THRESH_BINARY)
ret, dst = cv2.threshold(new_img, 180, 255, cv2.THRESH_BINARY_INV)
print(dst.shape)
print(ret)
while True:
    cv2.imshow('new_img', new_img)
    cv2.imshow('dst', dst)
    key = cv2.waitKey(10)
    if key & 0xFF == ord('q'):
        break
cv2.destroyAllWindows()